home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Documents / OOPClass / Labs / RPNCalculator / RPNCalculatorMain.m < prev    next >
Encoding:
Text File  |  1991-07-31  |  669 b   |  36 lines

  1.  
  2. // Main program for testing the Stack object 
  3.  
  4. // EXERCISE:  SEND MESSAGES AS REQUIRED TO PERFORM THE FUNCTIONS
  5. //       DESCRIBED BELOW.
  6.  
  7. #import <stdio.h>
  8. #import "RPNCalculator.h"
  9.  
  10. main ( argc, argv )
  11. int argc;
  12. char *argv[];
  13. {
  14.     id calc;
  15.     
  16.     printf("\nCreate an RPNCalculator instance...\n");
  17.  
  18.  
  19.     printf("Enter numbers 5.0, -10.0, -20.0, and 15.0 ...\n");  // and print the stack
  20.  
  21.                 
  22.     printf("Add...\n");  // and print the stack
  23.         [calc add];
  24.         [calc printStack];
  25.     
  26.     printf("Subtract...\n");  // and print the stack
  27.  
  28.     
  29.     printf("Clear the calculator's stack...\n");  // and print the stack
  30.  
  31.     
  32.     printf("Free the calculator and its  stack...\n");
  33.  
  34.  
  35. } // end of program
  36.